<template>
  <el-dialog :title="dialogProps.title" :visible.sync="dialogProps.visible" width='650px' append-to-body>
      <el-tabs >
            <el-tab-pane :label="form.name" name="first"></el-tab-pane>
      </el-tabs>
      <el-form   label-width="110px"  :model='form'  ref='form'  size='medium'>
            <el-row>
                <el-col :span='12'>
                      <el-form-item label="募集金额："  prop='collectionAmt'>
                              <el-input v-model.trim="form.collectionAmt"  ><template slot="suffix">元</template></el-input>
                      </el-form-item>
                      <el-form-item label="已还本金："  prop='capitalRepaidAmt'>
                              <el-input v-model.trim="form.capitalRepaidAmt"  ><template slot="suffix">元</template></el-input>
                      </el-form-item>
                      <el-form-item label="已还利息："  prop='interestRepaidAmt'>
                              <el-input v-model.trim="form.interestRepaidAmt"  ><template slot="suffix">元</template></el-input>
                      </el-form-item>
                      <el-form-item label="本息清算："  prop='ciClearingAmt'>
                              <el-input v-model.trim="form.ciClearingAmt"  ><template slot="suffix">元</template></el-input>
                      </el-form-item>
                      <el-form-item label="募集账户："  prop='collectionAccount'>
                              <el-input v-model.trim="form.collectionAccount" placeholder="请输入" ></el-input>
                      </el-form-item>
                      <el-form-item label="发行人账户："  prop='issueAccount'>
                              <el-input v-model.trim="form.issueAccount" placeholder="请输入" ></el-input>
                      </el-form-item>
                </el-col>
                <el-col  :span='11' class='ml10'>
                  <el-form-item label="剩余还款次数："  prop='name'>
                         <el-input v-model.trim="form.investmentAmt" placeholder="请输入" ></el-input>
                  </el-form-item>
                  <el-form-item label="服务费清算："  prop='name'>
                         <el-input v-model.trim="form.investmentAmt" placeholder="请输入" ></el-input>
                  </el-form-item>
                  <el-form-item label="成立日期："  prop='name'>
                          
                            <el-date-picker  style='width:170px;'
                              v-model.trim="form.foundDate"
                              type="date"
                              placeholder="选择日期">
                            </el-date-picker>
                          
                  </el-form-item>
                  <el-form-item label="起息日期："  prop='name'>
                          <el-date-picker  style='width:170px;'
                              v-model.trim="form.foundDate"
                              type="date"
                              placeholder="选择日期">
                            </el-date-picker>
                  </el-form-item>
                  <el-form-item label="到期日期："  prop='name'>
                            <el-date-picker  style='width:170px;'
                              v-model.trim="form.foundDate"
                              type="date"
                              placeholder="选择日期">
                            </el-date-picker>
                  </el-form-item>
                </el-col>
            </el-row>
      </el-form>
      <div slot='footer' class="dialog-footer">
              <el-button @click="dialogProps.visible = false">取 消</el-button>
              <el-button type="primary" @click="submit('form')">确 定</el-button>
      </div>
      
  </el-dialog>
</template>

<script charset="utf-8" type="text/javascript">
  import  { saveInvestor }  from  '@/api/professional_work/investor'
export default {
  name: 'ObjectEdit',
  data() {

    return {
      //文件上传请求地址
      actionAddress:process.env.BASE_API+'/op/fileupload/upload_file',

      loading: false,
      //dialogo基本信息  显示隐藏状态  title 
      dialogProps: {
        visible: false,
        action: '',
        title: '标的信息'
      },
      form:{
        name:'',
        idCode:'',
        subbranchName:'',
        bankAccount:'',
        investmentAmt:'',
        fileCode:'',
        foundDate:'',
      },

      

    }
  },
  created(){
    
    
  },
  methods: {
   
    submit(formName) {
      saveInvestor(this.form).then(res=>{
        this.$message({type:'success',message:res.data.msg})
        this.dialogProps.visible=false
      })
      
    },
    //文件上传成功之后的回调  保存文件
    handleSuccess(response, file, fileList){
      // console.log(response)
      // console.log(file)
      this.form.fileCode = file.response.data.code
    },
    handleExceed(files, fileList) {
        this.$message.warning(`超过上传一个文件最大限制！`);
    },
    
  },
  mounted: function() {
    this.$nextTick(() => {
      this.$on('openDialog', function(row) {
        this.dialogProps.visible = true
        this.dialogProps.title = '标的信息'
        this.form = row
        console.log(row)
      })
      
    })
  },
  updated(){
    
  },
  components:{
    
  }
}
</script>

<style  scoped>
</style>


